package com.baor.controller;

import com.baor.domain.MenuVo;
import com.baor.service.MenuService;
import com.baor.utils.AjaxResult;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired

    private MenuService menuService;
    @RequestMapping("/list")
    public AjaxResult<?> menuList(int roleId){
        return menuService.menuList(roleId);
    }
    @RequestMapping("/delete")
    public AjaxResult<?> delete(int menuId){
        return menuService.delete(menuId);
    }
    @RequestMapping("/update")
    public AjaxResult<?> update(@RequestBody  MenuVo menuVo){
        return this.menuService.update(menuVo);
    }
    @RequestMapping("/insert")
    public AjaxResult<?> insert(@RequestBody MenuVo menuVo){
        return this.menuService.insert(menuVo);
    }
    @RequestMapping("/allList")
    public AjaxResult<?> allList(@RequestBody Map<String,Object> params){
        return this.menuService.allMenuList(params);
    }
    @RequestMapping("/roleMenu")
    public AjaxResult<?> roleMenu(int roleId){
        return this.menuService.adminMenu(roleId);
    }


}
